package org.apache.commons.httpclient;

public class StatusLine
{
  private final String httpVersion;
  private final String reasonPhrase;
  private final int statusCode;
  private final String statusLine;

  public StatusLine(String paramString)
    throws HttpException
  {
    int i = paramString.length();
    int j = 0;
    int k = 0;
    try
    {
      while (Character.isWhitespace(paramString.charAt(k)))
      {
        int i5 = k + 1;
        ++j;
        k = i5;
      }
      int l = k + 4;
      try
      {
        if (!("HTTP".equals(paramString.substring(k, l))))
          throw new HttpException("Status-Line '" + paramString + "' does not start with HTTP");
      }
      catch (StringIndexOutOfBoundsException localStringIndexOutOfBoundsException2)
      {
        label98: throw new HttpException("Status-Line '" + paramString + "' is not valid");
      }
      int i1 = paramString.indexOf(" ", l);
      if (i1 <= 0)
        throw new ProtocolException("Unable to parse HTTP-Version from the status line: '" + paramString + "'");
      this.httpVersion = paramString.substring(j, i1).toUpperCase();
      while (paramString.charAt(i1) == ' ')
        ++i1;
      int i2 = paramString.indexOf(" ", i1);
      int i3 = i2;
      if (i3 < 0)
        i3 = i;
      try
      {
        this.statusCode = Integer.parseInt(paramString.substring(i1, i3));
        int i4 = i3 + 1;
        if (i4 < i)
        {
          this.reasonPhrase = paramString.substring(i4).trim();
          this.statusLine = paramString;
          return;
        }
      }
      catch (NumberFormatException localNumberFormatException)
      {
        throw new ProtocolException("Unable to parse status code from status line: '" + paramString + "'");
      }
      this.reasonPhrase = "";
    }
    catch (StringIndexOutOfBoundsException localStringIndexOutOfBoundsException1)
    {
      break label98:
    }
  }

  public static boolean startsWithHTTP(String paramString)
  {
    int i = 0;
    boolean bool1;
    try
    {
      while (Character.isWhitespace(paramString.charAt(i)))
        ++i;
      boolean bool2 = "HTTP".equals(paramString.substring(i, i + 4));
      bool1 = bool2;
      return bool1;
    }
    catch (StringIndexOutOfBoundsException localStringIndexOutOfBoundsException)
    {
      bool1 = false;
    }
  }

  public final String getHttpVersion()
  {
    return this.httpVersion;
  }

  public final String getReasonPhrase()
  {
    return this.reasonPhrase;
  }

  public final int getStatusCode()
  {
    return this.statusCode;
  }

  public final String toString()
  {
    return this.statusLine;
  }
}

/* Location:           E:\Desktop\Android\wordstd\classes_dex2jar.jar
 * Qualified Name:     org.apache.commons.httpclient.StatusLine
 * JD-Core Version:    0.5.3
 */